package com.itcast.demo.distributed_lock.service;

import com.itcast.demo.distributed_lock.thread.Stock;
import org.springframework.stereotype.Service;

@Service
public class StockService {

    private Stock stock = new Stock();

    public void duck() {
        stock.setStock(stock.getStock() - 1);
        System.out.println("剩余库存： " + stock.getStock());
    }
}
